<?php

/*------------------------------------------------
*
*   Explay Engine Content Management System.
*   Copyright © 2008 Golovdinov Alexander.
*
*-------------------------------------------------
*
*   Official site: wwww.alex-home.spb.ru/explay.html
*   Contact e-mail: golovdinov@gmail.com
*
*   GNU General Public License original source:
*   http://www.gnu.org/licenses/gpl-3.0.html
*
------------------------------------------------*/

if (!is_admin ()) error_403 ();

print "<ul>";

if (isset($small)) {
	print "\nАдминпанель\n<ul>";
	
	
	$get = $db->query ("SELECT href, name FROM ".DB_PEREFIX."_admin_cp WHERE `group` = 'system' OR `group` = 'utilities' ORDER BY name");

	while (list ($href, $name) = $db->fetch_row ($get)) {
		
		print "\r\n<li><a href=\"$href\" onmouseover=\"light_on(this);\" onmouseout=\"light_off(this);\">$name</a></li>";
		
	}
	
	print "\n</ul>";


} else {



	print "\nУправление модулями\n<ul>";
	
	$get_modules = $db->query ("SELECT module_name, module_header FROM ".DB_PEREFIX."_modules WHERE module_admin != ''");
	if ($db->num_rows($get_modules) > 0) {
		while (list($name, $header) = $db->fetch_row ($get_modules)) {	
				print "\n<li><a href=\"admin.php?name=$name\" onmouseover=\"light_on(this);\" onmouseout=\"light_off(this);\">$header</a></li>";
		}
	}
	else print "Нет управляемых модулей!";
	
	print "\n</ul>";
	print "\nМеню сайта</a>\n<ul>";
	
	$get_menu = $db->query ("SELECT link_group, link_text, link_url, link_target FROM ".DB_PEREFIX."_menu ORDER BY link_pos");
	
	while (list($mgroup, $mtext, $mlink, $mtarget) = $db->fetch_row ($get_menu)) {	
		print "\n<li><a href=\"$mlink\" target=\"_blank\" onmouseover=\"light_on(this);\" onmouseout=\"light_off(this);\">$mtext</a></li>";
	}
	
}
print "\n</ul>";
print "\n</ul>";
